﻿<UserControl x:Class="MaxStoreShop.WarehouseModule.ProductCategories.ProductCategoryEditor.ProductCategoryEditorView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:productCategoryEditor="clr-namespace:MaxStoreShop.WarehouseModule.ProductCategories.ProductCategoryEditor"
             xmlns:validators="clr-namespace:MaxStoreShop.Logic.Validators;assembly=MaxStoreShop.Logic"
             Style="{DynamicResource EditorStyle}"
             d:DataContext="{d:DesignInstance productCategoryEditor:ProductCategoryEditorViewModel}"
             d:DesignHeight="300"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Resources/Shared.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <TextBlock Margin="6"
                   VerticalAlignment="Center"
                   Text="Наименование:" />

        <TextBox Name="ProductCategoryNameTextBox"
                 Grid.Row="0"
                 Grid.Column="1"
                 Margin="6"
                 controls:TextboxHelper.IsWaitingForData="True"
                 controls:TextboxHelper.Watermark="Укажите наименование категории продукта">
            <TextBox.Text>
                <Binding Mode="TwoWay"
                         Path="SelectedItem.Name"
                         UpdateSourceTrigger="PropertyChanged"
                         ValidatesOnExceptions="True">
                    <Binding.ValidationRules>
                        <validators:StringNotEmptyValidator />
                    </Binding.ValidationRules>
                </Binding>
            </TextBox.Text>
        </TextBox>
    </Grid>
</UserControl>
